<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script type="text/javascript">
    var a= 3;
    if(a%1>0){
        alert(a+"是小数");
    }else {
        alert(a+"是整数");
    }
</script>
</body>
</html>